package com.ks.controller;


import com.ks.pojo.Dept;
import com.ks.service.DeptClientService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import java.util.List;

@RestController
public class DeptConsumerController {

    @Autowired
    private DeptClientService deptClientService = null;

    @RequestMapping("/consumer/dept/get/{id}")
    public Dept get(@PathVariable("id") Long id) {

        return deptClientService.get(id);
    }


    @RequestMapping("/consumer/dept/add")
    public boolean add(@RequestBody Dept dept) {

        return  deptClientService.add(dept);
    }

    @RequestMapping("/consumer/dept/list")
    public List<Dept> list() {

        return deptClientService.list();
    }






}
